<!DOCTYPE HTML>
<html>
  <head>
  <title>Cordova</title>
  <script type="text/javascript" charset="utf-8" src="cordova-2.2.0.js"></script>
  <script type="text/javascript" charset="utf-8">
  
  function onDeviceReady(){
	  navigator.notification.alert("Pronto!!", alertDismissed);
	  console.log("Device Ready....nahhhhh!!!!")
		
	  var fields = ["displayName","name"];
	  navigator.contacts.find(fields, onSuccess, onError);
	  
  }
  
  function alertDismissed(){
	  
  }
  
  function onError(){
	  
  }
  
  function onSuccess(){
	  navigator.notification.alert('Found ' + contacts.length + ' contacts.', alertDismissed);
	  for (var i=0; i<contacts.length; i++) {
		  console.log("Display Name = " + contacts[i].displayName);
	  }
  }
  
  function onError(){
	  alert('onError');
  }
  </script>
  </head>
  <body>
    <h1>Sample</h1>
  </body>
</html>